package com.fastCms;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.TimeZone;

@Slf4j
@SpringBootApplication
@EnableTransactionManagement
@ServletComponentScan
@MapperScan(basePackages = "com.fastCms")
@EnableKnife4j
public class ManagerApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ManagerApplication.class);
    }


    public static void main(String[] args) {
        Long time = System.currentTimeMillis();
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        SpringApplication.run(ManagerApplication.class, args);
        log.error("管理端 Manager 项目启动成功 用时：{} ms", System.currentTimeMillis() - time);
    }
}
